package empty.users;

import java.io.Serializable;
import java.util.Objects;

public class Department implements Serializable {

    private int id;
    private String name;
    private String manager;
    private int number_of_people;
    private int company_id;

    public Department() {
    }

    public Department(String name, String manager, int number_of_people, int company_id) {
        this.name = name;
        this.manager = manager;
        this.number_of_people = number_of_people;
        this.company_id = company_id;
    }

    public Department(int id, String name, String manager, int number_of_people, int company_id) {
        this.id = id;
        this.name = name;
        this.manager = manager;
        this.number_of_people = number_of_people;
        this.company_id = company_id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getManager() {
        return manager;
    }

    public void setManager(String manager) {
        this.manager = manager;
    }

    public int getNumber_of_people() {
        return number_of_people;
    }

    public void setNumber_of_people(int number_of_people) {
        this.number_of_people = number_of_people;
    }

    public int getCompany_id() {
        return company_id;
    }

    public void setCompany_id(int company_id) {
        this.company_id = company_id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Department that = (Department) o;
        return id == that.id && number_of_people == that.number_of_people && company_id == that.company_id && Objects.equals(name, that.name) && Objects.equals(manager, that.manager);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, manager, number_of_people, company_id);
    }

    @Override
    public String toString() {
        return "Department{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", manager='" + manager + '\'' +
                ", number_of_people=" + number_of_people +
                ", company_id=" + company_id +
                '}';
    }

    public Object [] toArray(){
        return new Object[]{
                id, name, manager, number_of_people, company_id
        };
    }

}
